﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FirstWpfApp
{
	public static class StaffFactory
	{
		public static Staff CreateNewStarff(string staffType, string name, int age)
		{
			Staff newStaff = null;
			switch (staffType)
			{
				case "Employee":
					newStaff = new Employee(name, age);
					break;
				case "Contractor":
					newStaff = new Contractor(name, age);
					break;
				case "Intern":
					newStaff = new Intern(name, age);
					break;
			}
			return newStaff;
		}

		public static FirstWpfApp.StaffDataSet.StaffsRow CreateNewStaffRow(string staffType, string name, int age, FirstWpfApp.StaffDataSet.StaffsDataTable staffDt)
		{
			StaffDataSet.StaffsRow row = staffDt.NewStaffsRow();
			//row.Id = 1;
			row.Id = 0;
			row.Name = name;
			row.Age = age;
			//as follow code, it is hardcode. 
			//TODO: should change to follow user's chose.
			row.Staff_Type = staffType;
			return row;
		}
	}
}
